<template>
  <dym-form v-if="inited" :debug="debug" :metas="formMetas" :config="formDef">

    <template v-slot:form_afterend="scope">
      <el-button @click="zform__callEvent('form-submit', scope, $event)">submit</el-button>
    </template>


    <template v-slot:prop_afterbegin="scope">
      <view></view>
    </template>

  </dym-form>
</template>

<script>
import {createZformCommon} from "@/zform/zform";

const formDef = {
  type: 'form', name: 'form_V033_p', serviceTpl: {def: {}, args: {src: 'bservice.twig'}}, def: {
    type: 'object',
    ui: {
      attrs: [['labelPostion', 'top'], ['label-position', 'top']],
      class: [],
      styleSheets: [[':host', {backgroundColor: 'rgba(163, 52, 52, 1)'}]]
    },
    properties: {
      field__znE17X3L4G: {
        type: 'string',
        INIT_CONFIG: {type: 'string'},
        ui: {widget: 'CusInput', label: '多行文本', widgetConfig: {type: 'textarea'}, desc: '这是一段描述'},
        computedFun: '',
        rules: [],
        server: {field_name: 'field__znE17X3L4G'},
        rules_json: '[]'
      },
      field__maAVwboZcm: {
        type: 'string',
        INIT_CONFIG: {type: 'string'},
        ui: {custom: true, widgetConfig: {}, cusWidget: 'CusCom'},
        computedFun: '',
        rules: [],
        server: {field_name: 'field__maAVwboZcm'},
        rules_json: '[]'
      },
      field__dtJTi3od1W: {
        type: 'number',
        ui: {label: '数字输入', widget: 'CusInputNumber', widgetConfig: {type: 'number'}},
        computedFun: '',
        rules: [{type: 'any'}],
        server: {field_name: 'field__dtJTi3od1W'},
        rules_json: "[{type:'any'}]"
      },
      field__F4x7elGrQv: {
        type: 'string',
        ui: {
          widget: 'CusSelect',
          label: '选择',
          widgetConfig: {options2: "[{label:'选项1',value:'option1'},{label:'选项2',value:'option2'}]"}
        },
        server: {field_name: 'field__F4x7elGrQv'}
      },
      field__Z0S1YJfvh5: {
        type: 'string',
        ui: {widget: 'CusTimePicker', label: '时间选择', widgetConfig: {valueFormat: 'HH:mm:ss'}},
        sub_type: 'time',
        server: {field_name: 'field__Z0S1YJfvh5'}
      },
      field__sP7WBKvDVh: {
        type: 'string',
        ui: {
          widget: 'CusDateTimePicker',
          label: '开始日期',
          widgetConfig: {type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss'}
        },
        sub_type: 'datetime',
        computedFun: '',
        rules: [],
        server: {field_name: 'field__sP7WBKvDVh'},
        rules_json: '[]'
      },
      field__YyYjmWcB90: {
        type: 'string',
        ui: {
          widget: 'CusDateTimePicker',
          label: '结束日期',
          widgetConfig: {type: 'datetime', valueFormat: 'YYYY-MM-DD HH:mm:ss'}
        },
        sub_type: 'datetime',
        computedFun: '',
        rules: [],
        server: {field_name: 'field__YyYjmWcB90'},
        rules_json: '[]'
      },
      field__ugSY5zltSF: {
        type: 'string',
        ui: {widget: 'CusInput', label: '时间间隔', widgetConfig: {}},
        computedFun: "时间间隔(MODEL('field__YyYjmWcB90'),MODEL('field__sP7WBKvDVh'))",
        rules: [],
        server: {field_name: 'field__ugSY5zltSF'},
        rules_json: '[]'
      },
      field__ydDVn_Womc: {
        type: 'string',
        ui: {
          widget: 'CusCheckbox',
          widgetConfig: {options2: "[{label:'选项1',value:'check1'},{label:'选项2',value:'check2'}]"}
        },
        server: {field_name: 'field__ydDVn_Womc'}
      },
      field__mtaWn46fDy: {
        type: 'string',
        ui: {
          widget: 'CusRadio',
          label: '单选',
          widgetConfig: {options2: "[{label:'选项1',value:'radio1'},{label:'选项2',value:'radio2'}]"}
        },
        server: {field_name: 'field__mtaWn46fDy'}
      },
      field__dD5oS9xNi7: {
        type: 'number',
        ui: {widget: 'CusSlider', label: '滑块', widgetConfig: {}},
        computedFun: '',
        rules: [],
        server: {field_name: 'field__dD5oS9xNi7'},
        rules_json: '[]'
      },
      field__rKrKlUFzvu: {
        type: 'number',
        ui: {label: '打分', widget: 'CusRate', widgetConfig: {}},
        server: {field_name: 'field__rKrKlUFzvu'}
      },
      field__KZxgpust9N: {
        type: 'string',
        INIT_CONFIG: {type: 'string'},
        ui: {
          widget: 'CusRichText',
          label: '',
          hiddenLabel: true,
          widgetConfig: {
            html_content: "{content:[{type:'paragraph',children:[{text:'图文展示2021'}]}],html:'<p class=\"w-e-p\">图文展示2021</p>'}",
            css_style: ':host {\n background-color: rgba(22, 159, 131, 0.6);\n color: rgba(254, 254, 254, 1);\n}'
          }
        },
        computedFun: '',
        rules: [],
        server: {field_name: 'field__KZxgpust9N'},
        css: "{cached:{':host':{backgroundColor:'rgba(22, 159, 131, 0.6)',color:'rgba(254, 254, 254, 1)'},':host(:hover) ':{},':host(:active) ':{},'.w-e-content-container':{}},css:':host {\\n background-color: rgba(22, 159, 131, 0.6);\\n color: rgba(254, 254, 254, 1);\\n}'}",
        rules_json: '[]'
      }
    },
    metas: {form_data: 'json_1c4ad'}
  }, computed: {}
};
const formComName = 'form-b';
const formMetas = {form_data: 'json_1c4ad'};
let zformCommon = createZformCommon({formDef, formComName, formMetas});

export default {
  mixins: [
    zformCommon
  ]
}
</script>
